import pandas as pd

data = pd.Series([1, 7, 5, 4, 6, 3])


def custom_discretize(x):
    if x < 3:
        return 'low'
    elif x < 6:
        return 'medium'
    else:
        return 'high'


# 自定义函数进行数据离散化
discretized_data = data.apply(custom_discretize)
print(discretized_data)